﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;

namespace BiliBiliCSharpStudy.old {
    public class DefaultTest {
        [Fact]
        public void TestDefault() {
            int a1 = default(int);
            Assert.Equal(0, a1);
            double a2 = default(double);
            Assert.Equal(0, a2);
            Level level = default(Level);
            Console.WriteLine($"level: {level}");
            Level2 level2 = default(Level2);
            Console.WriteLine($"level2: {level2}");
        }
    }
    class DefalutDemo {
        public static void demo() {
            int a1 = default(int);
            Console.WriteLine($"a1: {a1}");
            double a2 = default(double);
            Console.WriteLine($"a2: {a2}");
            Level level = default(Level);
            Console.WriteLine($"level: {level}");
            Level2 level2 = default(Level2);
            Console.WriteLine($"level2: {level2}");
        }
    }

    /**
     * `Level` 中有对应 `0` 的项，`default(Level)` 的值是 `Low`
     */
    enum Level {
        Mid = 1,
        Low = 0,
        High = 2
    }

    /**
     * 因为 `Level2` 中没有对应 `0` 的项，所以，`default(Level2)` 的值是 `0`
     */
    enum Level2 {
        Mid = 2,
        Low = 1,
        High = 3
    }
}
